<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
 <head>
  <title>cgttrs.f</title>
 <meta name="generator" content="emacs 21.3.1; htmlfontify 0.20">
<style type="text/css"><!-- 
body { background: rgb(255, 255, 255);  color: rgb(0, 0, 0);  font-style: normal;  font-weight: 500;  font-stretch: normal;  font-family: adobe-courier;  font-size: 11pt;  text-decoration: none; }
span.default   { background: rgb(255, 255, 255);  color: rgb(0, 0, 0);  font-style: normal;  font-weight: 500;  font-stretch: normal;  font-family: adobe-courier;  font-size: 11pt;  text-decoration: none; }
span.default a { background: rgb(255, 255, 255);  color: rgb(0, 0, 0);  font-style: normal;  font-weight: 500;  font-stretch: normal;  font-family: adobe-courier;  font-size: 11pt;  text-decoration: underline; }
span.string   { color: rgb(188, 143, 143);  background: rgb(255, 255, 255);  font-style: normal;  font-weight: 500;  font-stretch: normal;  font-family: adobe-courier;  font-size: 11pt;  text-decoration: none; }
span.string a { color: rgb(188, 143, 143);  background: rgb(255, 255, 255);  font-style: normal;  font-weight: 500;  font-stretch: normal;  font-family: adobe-courier;  font-size: 11pt;  text-decoration: underline; }
span.comment   { color: rgb(178, 34, 34);  background: rgb(255, 255, 255);  font-style: normal;  font-weight: 500;  font-stretch: normal;  font-family: adobe-courier;  font-size: 11pt;  text-decoration: none; }
span.comment a { color: rgb(178, 34, 34);  background: rgb(255, 255, 255);  font-style: normal;  font-weight: 500;  font-stretch: normal;  font-family: adobe-courier;  font-size: 11pt;  text-decoration: underline; }
 --></style>

 </head>
  <body>

<pre>
      SUBROUTINE <a name="CGTTRS.1"></a><a href="cgttrs.f.html#CGTTRS.1">CGTTRS</a>( TRANS, N, NRHS, DL, D, DU, DU2, IPIV, B, LDB,
     $                   INFO )
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  -- LAPACK routine (version 3.1) --
</span><span class="comment">*</span><span class="comment">     Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
</span><span class="comment">*</span><span class="comment">     November 2006
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">     .. Scalar Arguments ..
</span>      CHARACTER          TRANS
      INTEGER            INFO, LDB, N, NRHS
<span class="comment">*</span><span class="comment">     ..
</span><span class="comment">*</span><span class="comment">     .. Array Arguments ..
</span>      INTEGER            IPIV( * )
      COMPLEX            B( LDB, * ), D( * ), DL( * ), DU( * ), DU2( * )
<span class="comment">*</span><span class="comment">     ..
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  Purpose
</span><span class="comment">*</span><span class="comment">  =======
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  <a name="CGTTRS.20"></a><a href="cgttrs.f.html#CGTTRS.1">CGTTRS</a> solves one of the systems of equations
</span><span class="comment">*</span><span class="comment">     A * X = B,  A**T * X = B,  or  A**H * X = B,
</span><span class="comment">*</span><span class="comment">  with a tridiagonal matrix A using the LU factorization computed
</span><span class="comment">*</span><span class="comment">  by <a name="CGTTRF.23"></a><a href="cgttrf.f.html#CGTTRF.1">CGTTRF</a>.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  Arguments
</span><span class="comment">*</span><span class="comment">  =========
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  TRANS   (input) CHARACTER*1
</span><span class="comment">*</span><span class="comment">          Specifies the form of the system of equations.
</span><span class="comment">*</span><span class="comment">          = 'N':  A * X = B     (No transpose)
</span><span class="comment">*</span><span class="comment">          = 'T':  A**T * X = B  (Transpose)
</span><span class="comment">*</span><span class="comment">          = 'C':  A**H * X = B  (Conjugate transpose)
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  N       (input) INTEGER
</span><span class="comment">*</span><span class="comment">          The order of the matrix A.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  NRHS    (input) INTEGER
</span><span class="comment">*</span><span class="comment">          The number of right hand sides, i.e., the number of columns
</span><span class="comment">*</span><span class="comment">          of the matrix B.  NRHS &gt;= 0.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  DL      (input) COMPLEX array, dimension (N-1)
</span><span class="comment">*</span><span class="comment">          The (n-1) multipliers that define the matrix L from the
</span><span class="comment">*</span><span class="comment">          LU factorization of A.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  D       (input) COMPLEX array, dimension (N)
</span><span class="comment">*</span><span class="comment">          The n diagonal elements of the upper triangular matrix U from
</span><span class="comment">*</span><span class="comment">          the LU factorization of A.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  DU      (input) COMPLEX array, dimension (N-1)
</span><span class="comment">*</span><span class="comment">          The (n-1) elements of the first super-diagonal of U.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  DU2     (input) COMPLEX array, dimension (N-2)
</span><span class="comment">*</span><span class="comment">          The (n-2) elements of the second super-diagonal of U.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  IPIV    (input) INTEGER array, dimension (N)
</span><span class="comment">*</span><span class="comment">          The pivot indices; for 1 &lt;= i &lt;= n, row i of the matrix was
</span><span class="comment">*</span><span class="comment">          interchanged with row IPIV(i).  IPIV(i) will always be either
</span><span class="comment">*</span><span class="comment">          i or i+1; IPIV(i) = i indicates a row interchange was not
</span><span class="comment">*</span><span class="comment">          required.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  B       (input/output) COMPLEX array, dimension (LDB,NRHS)
</span><span class="comment">*</span><span class="comment">          On entry, the matrix of right hand side vectors B.
</span><span class="comment">*</span><span class="comment">          On exit, B is overwritten by the solution vectors X.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  LDB     (input) INTEGER
</span><span class="comment">*</span><span class="comment">          The leading dimension of the array B.  LDB &gt;= max(1,N).
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  INFO    (output) INTEGER
</span><span class="comment">*</span><span class="comment">          = 0:  successful exit
</span><span class="comment">*</span><span class="comment">          &lt; 0:  if INFO = -k, the k-th argument had an illegal value
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  =====================================================================
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">     .. Local Scalars ..
</span>      LOGICAL            NOTRAN
      INTEGER            ITRANS, J, JB, NB
<span class="comment">*</span><span class="comment">     ..
</span><span class="comment">*</span><span class="comment">     .. External Functions ..
</span>      INTEGER            <a name="ILAENV.79"></a><a href="ilaenv.f.html#ILAENV.1">ILAENV</a>
      EXTERNAL           <a name="ILAENV.80"></a><a href="ilaenv.f.html#ILAENV.1">ILAENV</a>
<span class="comment">*</span><span class="comment">     ..
</span><span class="comment">*</span><span class="comment">     .. External Subroutines ..
</span>      EXTERNAL           <a name="CGTTS2.83"></a><a href="cgtts2.f.html#CGTTS2.1">CGTTS2</a>, <a name="XERBLA.83"></a><a href="xerbla.f.html#XERBLA.1">XERBLA</a>
<span class="comment">*</span><span class="comment">     ..
</span><span class="comment">*</span><span class="comment">     .. Intrinsic Functions ..
</span>      INTRINSIC          MAX, MIN
<span class="comment">*</span><span class="comment">     ..
</span><span class="comment">*</span><span class="comment">     .. Executable Statements ..
</span><span class="comment">*</span><span class="comment">
</span>      INFO = 0
      NOTRAN = ( TRANS.EQ.<span class="string">'N'</span> .OR. TRANS.EQ.<span class="string">'n'</span> )
      IF( .NOT.NOTRAN .AND. .NOT.( TRANS.EQ.<span class="string">'T'</span> .OR. TRANS.EQ.
     $    <span class="string">'t'</span> ) .AND. .NOT.( TRANS.EQ.<span class="string">'C'</span> .OR. TRANS.EQ.<span class="string">'c'</span> ) ) THEN
         INFO = -1
      ELSE IF( N.LT.0 ) THEN
         INFO = -2
      ELSE IF( NRHS.LT.0 ) THEN
         INFO = -3
      ELSE IF( LDB.LT.MAX( N, 1 ) ) THEN
         INFO = -10
      END IF
      IF( INFO.NE.0 ) THEN
         CALL <a name="XERBLA.103"></a><a href="xerbla.f.html#XERBLA.1">XERBLA</a>( <span class="string">'<a name="CGTTRS.103"></a><a href="cgttrs.f.html#CGTTRS.1">CGTTRS</a>'</span>, -INFO )
         RETURN
      END IF
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">     Quick return if possible
</span><span class="comment">*</span><span class="comment">
</span>      IF( N.EQ.0 .OR. NRHS.EQ.0 )
     $   RETURN
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">     Decode TRANS
</span><span class="comment">*</span><span class="comment">
</span>      IF( NOTRAN ) THEN
         ITRANS = 0
      ELSE IF( TRANS.EQ.<span class="string">'T'</span> .OR. TRANS.EQ.<span class="string">'t'</span> ) THEN
         ITRANS = 1
      ELSE
         ITRANS = 2
      END IF
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">     Determine the number of right-hand sides to solve at a time.
</span><span class="comment">*</span><span class="comment">
</span>      IF( NRHS.EQ.1 ) THEN
         NB = 1
      ELSE
         NB = MAX( 1, <a name="ILAENV.127"></a><a href="ilaenv.f.html#ILAENV.1">ILAENV</a>( 1, <span class="string">'<a name="CGTTRS.127"></a><a href="cgttrs.f.html#CGTTRS.1">CGTTRS</a>'</span>, TRANS, N, NRHS, -1, -1 ) )
      END IF
<span class="comment">*</span><span class="comment">
</span>      IF( NB.GE.NRHS ) THEN
         CALL <a name="CGTTS2.131"></a><a href="cgtts2.f.html#CGTTS2.1">CGTTS2</a>( ITRANS, N, NRHS, DL, D, DU, DU2, IPIV, B, LDB )
      ELSE
         DO 10 J = 1, NRHS, NB
            JB = MIN( NRHS-J+1, NB )
            CALL <a name="CGTTS2.135"></a><a href="cgtts2.f.html#CGTTS2.1">CGTTS2</a>( ITRANS, N, JB, DL, D, DU, DU2, IPIV, B( 1, J ),
     $                   LDB )
   10    CONTINUE
      END IF
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">     End of <a name="CGTTRS.140"></a><a href="cgttrs.f.html#CGTTRS.1">CGTTRS</a>
</span><span class="comment">*</span><span class="comment">
</span>      END

</pre>

 </body>
</html>
